<?php
/**
 * Created by PhpStorm.
 * User: 18048
 * Date: 2018/5/7
 * Time: 11:14
 */

$http = new swoole_http_server("0.0.0.0",9501);

$http->on("start",function($server){
    echo "Swoole http server is started at http://0.0.0.0:9501\n";
});

$http->on("request",function($request,$response){
   $response->header("Content-Type","text/plain");
    echo $request->get['hello'];
   $response->end("Hello World\n");
});

$http->start();
